import { Modifier } from "../../base/Modifier";
import { LineCapStyle } from "../../entity/Enum";

export class LineCapModifier extends Modifier {
    static identity = Symbol("linecap");

    applyPeer(node: any, jsValue: any) {
        //通用检查入参格式是否为对象。   
        let lineCap = LineCapStyle.BUTT;
        if (jsValue === null || jsValue === undefined) {
            // undefined value use default value.
            lineCap = LineCapStyle.BUTT;
        } else if (typeof jsValue !== "number") {
            console.log("SetLineCap: The first param type is not number, invalid.");
            return;
        } else if (jsValue  in LineCapStyle) {
            lineCap = jsValue;
        }
        else {
            console.log("SLineCap: The first param type is a visibility value.");
            return;
        }

        // Call ViewAbstractModel's JsGridSpan without callback
        // ViewAbstractModel::GetInstance()->SetGrid(span, std::nullopt);

    }
}